Is it possible to use custom RequireAuthorization and AllowAnonymous for custom middleware authentic

Leveraging Custom Middleware Authentication in ASP.NET Core 6 Minimal APIs

Extending .NET Minimal APIs with Swagger, Authentication & Validation

Basics Part 1: Introduction to ASP.NET Core Authentication & Authorization

.Net 7 (Preview 4) - Minimal API - Multiple Result Type - Route Groups